
const baseURL = "https://lingwu.pro/api/station";
// const baseURL = "http://localhost:8080/api/station";

function getUrlFor(path?: string, params?: any) {
  let res =  `${baseURL}${path}`;
  if (params) res+='?';
  for (const paramsKey in params) {
    res += `${encodeURIComponent(paramsKey)}=${encodeURIComponent(params[paramsKey])}&`;
  }
  return res;
}

export {getUrlFor}
